<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form>
        <input type="text" name="uname">
        <input type="password" name="password" >
        <button>提交</button>
    </form>
    <script src="./jquery-v3.6.0.js"></script>
    <script>
        $(function(){
            $('form').on('submit',function(e){
                e.preventDefault()
                const str = $(this).serialize()
                $.ajax({
                    type:'POST',
                    url:'http://www.liulongbin.top:3006/api/form',
                    data:str,
                    success:function(res){
                        console.log(res);
                    }
                })
            })
        })
    </script>
</body>
</html>